import { get, post} from './request'
import axios from "axios"
axios.defaults.withCredentials=true;

// 登录
export const login = (params) => post('/login', params)
// 图片上传
export const upLoad = (file) => post('/fileUpload', file)

// 查询所有新闻
export const searchAllNews = (params) => get('/selectAllJournalism', params)

// 根据id查询新闻
export const searchNewById = (id) => get('/selectOneJournalism', id)

// 新增一条新闻
export const addNew = (params) => post('/addJournalism', params)

// 修改一条新闻
export const editNew = (params) => post('/updateJournalismById', params)

// 查询所有学生
export const searchAllStudent = (params) => get('/selectAllStudent', params)

// 根据id查询学生
export const searchStudentById = (id) => get('/selectOneStudent', id)

// 新增学生
export const addStudent = (params) => post('/insertStudent', params)

// 修改学生
export const editStudent = (params) => post('/updateStudent', params)

//根据schoolId查询所有的班级
export const searchClassById = (params) => get('/classTabController/selectAllClassBySchool', params)

// 插入一个班级信息
export const addClass = (params) => post('/classTabController/insertClasses', params)

// 更新班级名称
export const editClass = (params) => post('/classTabController/updateClassById', params)

// 根据Id删除班级信息
export const delClassById = (params) => get('/classTabController/delClassById', params)

// 查询一个班级详细信息
export const checkClassDetail = (params) => get('/classTabController/selectOneClass', params)

// 查询所有学校
export const searchAllSchool = (params) => get('/getAllSchool', params)

// 根据Id查询学校
export const searchSchoolById = (params) => get('/selectOneSchool', params)

// 新增学校
export const addNewSchool = (params) => post('/addSchool', params)

// 更新学校
export const editSchool = (params) => post('/updatedSchoolById', params)
